package chain.example.delivery.old;


import chain.example.delivery.DeliveryState;

import java.util.ArrayList;
import java.util.List;

public class Client {
    public static void main(String[] args) {
        System.out.println(getMessage(DeliveryState.PAYED.getState()));

        System.out.println(getMessage(DeliveryState.SHOP.getState()));

        System.out.println(getMessage(DeliveryState.REAL_DELIVERY.getState()));
    }

    private static List<String> getMessage(int state) {
        List<String> all = new ArrayList<>();
        if(state>= DeliveryState.PAYED.getState()){
            List<String> payInfo = new ArrayList<>();
            payInfo.add("已支付");

            all.addAll(payInfo);
        }
        if(state>= DeliveryState.SHOP.getState()){
            List<String> shopInfo = new ArrayList<>();
            shopInfo.add("商家已发货");

            all.addAll(shopInfo);
        }
        if(state>= DeliveryState.REAL_DELIVERY.getState()){
            List<String> realDeliveryInfo = new ArrayList<>();
            realDeliveryInfo.add("商品已从深圳出发");
            realDeliveryInfo.add("到达武汉");
            realDeliveryInfo.add("正在派件");
            realDeliveryInfo.add("已签收");

            all.addAll(realDeliveryInfo);
        }
        return all;
    }
}
